<!doctype html>
<html>
<head>
<#include "/part_meta.ftl">
<title>PIN码-迈小众</title>
<link href="${st.resDomain}/css/style.css" rel="stylesheet" type="text/css">
<link href="${st.resDomain}/css/store.css" rel="stylesheet" type="text/css">
<link href="${st.resDomain}/css/autostyle.css" rel="stylesheet" type="text/css">
</head>

<body>
<!--头部-->
<header>
  <div class="boxw store">
    <div class="header">
      <span class="f_left"><a href="javascript:history.back();" class="back"></a></span>
      <span class="title">PIN码</span>
      <span class="f_right"><a class="more"></a></span>
    </div>
    <div class="more">
      <a href="${st.userDomain}/shoppingCart" class="icon-car">购物车</a>
      <a href="${st.userDomain}/" class="icon-user">个人中心</a>
      <a href="${st.domain}/" class="icon-home">主页</a>
    </div>
  </div>
</header>
<!--头部 END-->

<div class="main boxw">
  <div class="form">
   <form id="mForm">
    <h2>PIN码：<#if pin == 0><span id="pinCode" style="font-size:0.6em;">未设置，请点击“刷新”按钮进行设置<#else><span id="pinCode">${pin}</#if></span><span style="padding-left:5%;"><input type="button" value="刷新" id="pinRefreshBt"/></span></h2>
   </form>
  </div>
</div>
<script src="${st.resDomain}/scripts/jquery-1.9.1.min.js"></script>
<script src="${st.resDomain}/scripts/com.js"></script>
<script type="text/javascript">
	var refreshPINPath = g_userDomain + "/member/pinDo/json";
	
	// 事件：刷新PIN
	$("#pinRefreshBt").click(function() {
		$.post(refreshPINPath, {}, function(data) {
			if (data.status === 0) {
				showMsg(data.message, 'pass');
				var pin = data.result;
				$("#pinCode").html(pin);
			} else {
				showMsg(data.message, 'error');
			}
		});
	});

</script>
</body>
</html>
